{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Python for Finance"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Analyze Big Financial Data**\n",
    "\n",
    "O'Reilly (2014)\n",
    "\n",
    "Yves Hilpisch"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img style=\"border:0px solid grey;\" src=\"http://hilpisch.com/python_for_finance.png\" alt=\"Python for Finance\" width=\"30%\" align=\"left\" border=\"0\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Buy the book ** |\n",
    "<a href='http://shop.oreilly.com/product/0636920032441.do' target='_blank'>O'Reilly</a> |\n",
    "<a href='http://www.amazon.com/Yves-Hilpisch/e/B00JCYHHJM' target='_blank'>Amazon</a>\n",
    "\n",
    "**All book codes & IPYNBs** |\n",
    "<a href=\"http://oreilly.quant-platform.com\">http://oreilly.quant-platform.com</a>\n",
    "\n",
    "**The Python Quants GmbH** | <a href='http://tpq.io' target='_blank'>http://tpq.io</a>\n",
    "\n",
    "**Contact us** | <a href='mailto:pff@tpq.io'>pff@tpq.io</a>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Volatility Options"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pylab import plt\n",
    "plt.style.use('seaborn')\n",
    "import matplotlib as mpl\n",
    "mpl.rcParams['font.family'] = 'serif'\n",
    "# import warnings; warnings.simplefilter('ignore')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The VSTOXX Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append('../python36/')\n",
    "sys.path.append('../python36/dxa')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "uuid": "9d8e35b5-239f-4b3c-85dd-f7807b6fb39d"
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### VSTOXX Index Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "uuid": "bec1849e-b622-463c-a559-bd3a6ab82824"
   },
   "outputs": [],
   "source": [
    "url = 'http://www.stoxx.com/download/historical_values/h_vstoxx.txt'\n",
    "vstoxx_index = pd.read_csv(url, index_col=0, header=2,\n",
    "                           parse_dates=True, dayfirst=True,\n",
    "                           sep=',')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# vstoxx_index.to_csv('source/vstoxx_index.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "uuid": "e895e580-70dd-46b0-bcd1-9e686e226520"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "DatetimeIndex: 4357 entries, 1999-01-04 to 2016-02-12\n",
      "Data columns (total 9 columns):\n",
      "V2TX    4357 non-null float64\n",
      "V6I1    3906 non-null float64\n",
      "V6I2    4357 non-null float64\n",
      "V6I3    4296 non-null float64\n",
      "V6I4    4357 non-null float64\n",
      "V6I5    4357 non-null float64\n",
      "V6I6    4340 non-null float64\n",
      "V6I7    4357 non-null float64\n",
      "V6I8    4343 non-null float64\n",
      "dtypes: float64(9)\n",
      "memory usage: 340.4 KB\n"
     ]
    }
   ],
   "source": [
    "vstoxx_index.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "uuid": "2d7b9982-0f4a-4af9-abd0-af23ca157775"
   },
   "outputs": [],
   "source": [
    "vstoxx_index = vstoxx_index[('2013/12/31' < vstoxx_index.index)\n",
    "                            & (vstoxx_index.index < '2014/4/1')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "uuid": "189bc6a0-af48-4e05-afaa-ddb78d44b0ae"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>V2TX</th>\n",
       "      <th>V6I1</th>\n",
       "      <th>V6I2</th>\n",
       "      <th>V6I3</th>\n",
       "      <th>V6I4</th>\n",
       "      <th>V6I5</th>\n",
       "      <th>V6I6</th>\n",
       "      <th>V6I7</th>\n",
       "      <th>V6I8</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2014-03-25</th>\n",
       "      <td>18.26</td>\n",
       "      <td>18.23</td>\n",
       "      <td>18.31</td>\n",
       "      <td>19.04</td>\n",
       "      <td>19.84</td>\n",
       "      <td>20.31</td>\n",
       "      <td>18.11</td>\n",
       "      <td>20.83</td>\n",
       "      <td>21.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-03-26</th>\n",
       "      <td>17.59</td>\n",
       "      <td>17.48</td>\n",
       "      <td>17.70</td>\n",
       "      <td>18.45</td>\n",
       "      <td>19.42</td>\n",
       "      <td>20.00</td>\n",
       "      <td>20.26</td>\n",
       "      <td>20.45</td>\n",
       "      <td>20.86</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-03-27</th>\n",
       "      <td>17.64</td>\n",
       "      <td>17.50</td>\n",
       "      <td>17.76</td>\n",
       "      <td>18.62</td>\n",
       "      <td>19.49</td>\n",
       "      <td>20.05</td>\n",
       "      <td>20.11</td>\n",
       "      <td>20.49</td>\n",
       "      <td>20.94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-03-28</th>\n",
       "      <td>17.03</td>\n",
       "      <td>16.68</td>\n",
       "      <td>17.29</td>\n",
       "      <td>18.33</td>\n",
       "      <td>19.30</td>\n",
       "      <td>19.83</td>\n",
       "      <td>20.14</td>\n",
       "      <td>20.38</td>\n",
       "      <td>20.82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-03-31</th>\n",
       "      <td>17.66</td>\n",
       "      <td>17.61</td>\n",
       "      <td>17.69</td>\n",
       "      <td>18.57</td>\n",
       "      <td>19.43</td>\n",
       "      <td>20.04</td>\n",
       "      <td>19.98</td>\n",
       "      <td>20.44</td>\n",
       "      <td>20.90</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             V2TX   V6I1   V6I2   V6I3   V6I4   V6I5   V6I6   V6I7   V6I8\n",
       "Date                                                                     \n",
       "2014-03-25  18.26  18.23  18.31  19.04  19.84  20.31  18.11  20.83  21.20\n",
       "2014-03-26  17.59  17.48  17.70  18.45  19.42  20.00  20.26  20.45  20.86\n",
       "2014-03-27  17.64  17.50  17.76  18.62  19.49  20.05  20.11  20.49  20.94\n",
       "2014-03-28  17.03  16.68  17.29  18.33  19.30  19.83  20.14  20.38  20.82\n",
       "2014-03-31  17.66  17.61  17.69  18.57  19.43  20.04  19.98  20.44  20.90"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.round(vstoxx_index.tail(), 2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### VSTOXX Futures Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "uuid": "f55aa47f-15d5-4bfb-858c-3464101550c2"
   },
   "outputs": [],
   "source": [
    "vstoxx_futures = pd.read_excel('./source/vstoxx_march_2014.xlsx',\n",
    "                               'vstoxx_futures')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "uuid": "b03426df-f692-4879-8136-e3adc53a7c73"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 504 entries, 0 to 503\n",
      "Data columns (total 8 columns):\n",
      "A_DATE                       504 non-null datetime64[ns]\n",
      "A_EXP_YEAR                   504 non-null int64\n",
      "A_EXP_MONTH                  504 non-null int64\n",
      "A_CALL_PUT_FLAG              504 non-null object\n",
      "A_EXERCISE_PRICE             504 non-null int64\n",
      "A_SETTLEMENT_PRICE_SCALED    504 non-null int64\n",
      "A_PRODUCT_ID                 504 non-null object\n",
      "SETTLE                       504 non-null float64\n",
      "dtypes: datetime64[ns](1), float64(1), int64(4), object(2)\n",
      "memory usage: 31.6+ KB\n"
     ]
    }
   ],
   "source": [
    "vstoxx_futures.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "uuid": "cb69ca05-6568-4742-8a15-1355eb25ab2a"
   },
   "outputs": [],
   "source": [
    "del vstoxx_futures['A_SETTLEMENT_PRICE_SCALED']\n",
    "del vstoxx_futures['A_CALL_PUT_FLAG']\n",
    "del vstoxx_futures['A_EXERCISE_PRICE']\n",
    "del vstoxx_futures['A_PRODUCT_ID']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "uuid": "3b0a398d-b9d0-4826-8a32-65259768396a"
   },
   "outputs": [],
   "source": [
    "columns = ['DATE', 'EXP_YEAR', 'EXP_MONTH', 'PRICE']\n",
    "vstoxx_futures.columns = columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "uuid": "f82ad34e-431b-4827-971c-cb768e4d3632"
   },
   "outputs": [],
   "source": [
    "import datetime as dt\n",
    "import calendar\n",
    "\n",
    "def third_friday(date):\n",
    "    day = 21 - (calendar.weekday(date.year, date.month, 1) + 2) % 7\n",
    "    return dt.datetime(date.year, date.month, day)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "uuid": "2715995a-3122-472c-9b6b-8c425e3eac10"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "set(vstoxx_futures['EXP_MONTH'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "uuid": "7b62171f-6817-4fcb-9976-1d0fc7731375"
   },
   "outputs": [],
   "source": [
    "third_fridays = {}\n",
    "for month in set(vstoxx_futures['EXP_MONTH']):\n",
    "    third_fridays[month] = third_friday(dt.datetime(2014, month, 1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "uuid": "0363243b-5218-45f5-9d92-263d13550a86"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: datetime.datetime(2014, 1, 17, 0, 0),\n",
       " 2: datetime.datetime(2014, 2, 21, 0, 0),\n",
       " 3: datetime.datetime(2014, 3, 21, 0, 0),\n",
       " 4: datetime.datetime(2014, 4, 18, 0, 0),\n",
       " 5: datetime.datetime(2014, 5, 16, 0, 0),\n",
       " 6: datetime.datetime(2014, 6, 20, 0, 0),\n",
       " 7: datetime.datetime(2014, 7, 18, 0, 0),\n",
       " 8: datetime.datetime(2014, 8, 15, 0, 0),\n",
       " 9: datetime.datetime(2014, 9, 19, 0, 0),\n",
       " 10: datetime.datetime(2014, 10, 17, 0, 0),\n",
       " 11: datetime.datetime(2014, 11, 21, 0, 0)}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "third_fridays"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "uuid": "55c35e4b-359d-49b5-a002-e5dfb4c89bae"
   },
   "outputs": [],
   "source": [
    "tf = lambda x: third_fridays[x]\n",
    "vstoxx_futures['MATURITY'] = vstoxx_futures['EXP_MONTH'].apply(tf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "uuid": "861ce5e7-6a8a-4ad0-998a-4f998b3f1abe"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>DATE</th>\n",
       "      <th>EXP_YEAR</th>\n",
       "      <th>EXP_MONTH</th>\n",
       "      <th>PRICE</th>\n",
       "      <th>MATURITY</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>499</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>7</td>\n",
       "      <td>20.40</td>\n",
       "      <td>2014-07-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>500</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>8</td>\n",
       "      <td>20.70</td>\n",
       "      <td>2014-08-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>501</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>9</td>\n",
       "      <td>20.95</td>\n",
       "      <td>2014-09-19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>502</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>21.05</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>503</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>11</td>\n",
       "      <td>21.25</td>\n",
       "      <td>2014-11-21</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          DATE  EXP_YEAR  EXP_MONTH  PRICE   MATURITY\n",
       "499 2014-03-31      2014          7  20.40 2014-07-18\n",
       "500 2014-03-31      2014          8  20.70 2014-08-15\n",
       "501 2014-03-31      2014          9  20.95 2014-09-19\n",
       "502 2014-03-31      2014         10  21.05 2014-10-17\n",
       "503 2014-03-31      2014         11  21.25 2014-11-21"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vstoxx_futures.tail()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### VSTOXX Options Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "uuid": "e57c3899-e4f4-41d4-8caf-a48a33cf5f1d"
   },
   "outputs": [],
   "source": [
    "vstoxx_options = pd.read_excel('./source/vstoxx_march_2014.xlsx',\n",
    "                               'vstoxx_options')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "uuid": "530e2488-d694-4bf9-8a36-925dda5a1169"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 46960 entries, 0 to 46959\n",
      "Data columns (total 8 columns):\n",
      "A_DATE                       46960 non-null datetime64[ns]\n",
      "A_EXP_YEAR                   46960 non-null int64\n",
      "A_EXP_MONTH                  46960 non-null int64\n",
      "A_CALL_PUT_FLAG              46960 non-null object\n",
      "A_EXERCISE_PRICE             46960 non-null int64\n",
      "A_SETTLEMENT_PRICE_SCALED    46960 non-null int64\n",
      "A_PRODUCT_ID                 46960 non-null object\n",
      "SETTLE                       46960 non-null float64\n",
      "dtypes: datetime64[ns](1), float64(1), int64(4), object(2)\n",
      "memory usage: 2.9+ MB\n"
     ]
    }
   ],
   "source": [
    "vstoxx_options.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "uuid": "d327407e-5645-4850-9296-8ed2a42a9f02"
   },
   "outputs": [],
   "source": [
    "del vstoxx_options['A_SETTLEMENT_PRICE_SCALED']\n",
    "del vstoxx_options['A_PRODUCT_ID']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "uuid": "aa1b23d5-3f09-4059-a5c1-c5c3d7b5619e"
   },
   "outputs": [],
   "source": [
    "columns = ['DATE', 'EXP_YEAR', 'EXP_MONTH', 'TYPE', 'STRIKE', 'PRICE']\n",
    "vstoxx_options.columns = columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "uuid": "9c503624-0ad5-43d4-aa05-bef9123b65cd"
   },
   "outputs": [],
   "source": [
    "vstoxx_options['MATURITY'] = vstoxx_options['EXP_MONTH'].apply(tf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "uuid": "2f07b024-89ff-40d2-b99a-23715299fdb5"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>DATE</th>\n",
       "      <th>EXP_YEAR</th>\n",
       "      <th>EXP_MONTH</th>\n",
       "      <th>TYPE</th>\n",
       "      <th>STRIKE</th>\n",
       "      <th>PRICE</th>\n",
       "      <th>MATURITY</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-01-02</td>\n",
       "      <td>2014</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>1000</td>\n",
       "      <td>7.95</td>\n",
       "      <td>2014-01-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2014-01-02</td>\n",
       "      <td>2014</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>1500</td>\n",
       "      <td>3.05</td>\n",
       "      <td>2014-01-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2014-01-02</td>\n",
       "      <td>2014</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>1600</td>\n",
       "      <td>2.20</td>\n",
       "      <td>2014-01-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2014-01-02</td>\n",
       "      <td>2014</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>1700</td>\n",
       "      <td>1.60</td>\n",
       "      <td>2014-01-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2014-01-02</td>\n",
       "      <td>2014</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>1800</td>\n",
       "      <td>1.15</td>\n",
       "      <td>2014-01-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        DATE  EXP_YEAR  EXP_MONTH TYPE  STRIKE  PRICE   MATURITY\n",
       "0 2014-01-02      2014          1    C    1000   7.95 2014-01-17\n",
       "1 2014-01-02      2014          1    C    1500   3.05 2014-01-17\n",
       "2 2014-01-02      2014          1    C    1600   2.20 2014-01-17\n",
       "3 2014-01-02      2014          1    C    1700   1.60 2014-01-17\n",
       "4 2014-01-02      2014          1    C    1800   1.15 2014-01-17"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vstoxx_options.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "uuid": "ad2ab7b1-ea0b-4275-90a6-89b9f78f50b0"
   },
   "outputs": [],
   "source": [
    "vstoxx_options['STRIKE'] = vstoxx_options['STRIKE'] / 100."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "uuid": "a2590862-a144-402c-998f-9161797fb7d2"
   },
   "outputs": [],
   "source": [
    "save = False\n",
    "if save is True:\n",
    "    import warnings\n",
    "    warnings.simplefilter('ignore')\n",
    "    h5 = pd.HDFStore('./source/vstoxx_march_2014.h5',\n",
    "                     complevel=9, complib='blosc')\n",
    "    h5['vstoxx_index'] = vstoxx_index\n",
    "    h5['vstoxx_futures'] = vstoxx_futures\n",
    "    h5['vstoxx_options'] = vstoxx_options\n",
    "    h5.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Model Calibration"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Relevant Market Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "uuid": "c93f5398-8620-48d1-9c6b-ae0c79653751"
   },
   "outputs": [],
   "source": [
    "pricing_date = dt.datetime(2014, 3, 31)\n",
    "  # last trading day in March 2014\n",
    "maturity = third_fridays[10]\n",
    "  # October maturity\n",
    "initial_value = vstoxx_index['V2TX'][pricing_date]\n",
    "  # VSTOXX on pricing_date\n",
    "forward = vstoxx_futures[(vstoxx_futures.DATE == pricing_date)\n",
    "            & (vstoxx_futures.MATURITY == maturity)]['PRICE'].values[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "uuid": "bd8f1656-44b5-46fc-ab91-f3d14398c09a"
   },
   "outputs": [],
   "source": [
    "tol = 0.20\n",
    "option_selection = \\\n",
    "    vstoxx_options[(vstoxx_options.DATE == pricing_date)\n",
    "                 & (vstoxx_options.MATURITY == maturity)\n",
    "                 & (vstoxx_options.TYPE == 'C')\n",
    "                 & (vstoxx_options.STRIKE > (1 - tol) * forward)\n",
    "                 & (vstoxx_options.STRIKE < (1 + tol) * forward)]                            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "uuid": "ca4e9611-eda9-4868-8823-5187695ea02f"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>DATE</th>\n",
       "      <th>EXP_YEAR</th>\n",
       "      <th>EXP_MONTH</th>\n",
       "      <th>TYPE</th>\n",
       "      <th>STRIKE</th>\n",
       "      <th>PRICE</th>\n",
       "      <th>MATURITY</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>46482</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>17.0</td>\n",
       "      <td>4.85</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46483</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>18.0</td>\n",
       "      <td>4.30</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46484</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>19.0</td>\n",
       "      <td>3.80</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46485</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>20.0</td>\n",
       "      <td>3.40</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46486</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>21.0</td>\n",
       "      <td>3.05</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46487</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>22.0</td>\n",
       "      <td>2.75</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46488</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>23.0</td>\n",
       "      <td>2.50</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46489</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>24.0</td>\n",
       "      <td>2.25</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46490</th>\n",
       "      <td>2014-03-31</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "      <td>C</td>\n",
       "      <td>25.0</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2014-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            DATE  EXP_YEAR  EXP_MONTH TYPE  STRIKE  PRICE   MATURITY\n",
       "46482 2014-03-31      2014         10    C    17.0   4.85 2014-10-17\n",
       "46483 2014-03-31      2014         10    C    18.0   4.30 2014-10-17\n",
       "46484 2014-03-31      2014         10    C    19.0   3.80 2014-10-17\n",
       "46485 2014-03-31      2014         10    C    20.0   3.40 2014-10-17\n",
       "46486 2014-03-31      2014         10    C    21.0   3.05 2014-10-17\n",
       "46487 2014-03-31      2014         10    C    22.0   2.75 2014-10-17\n",
       "46488 2014-03-31      2014         10    C    23.0   2.50 2014-10-17\n",
       "46489 2014-03-31      2014         10    C    24.0   2.25 2014-10-17\n",
       "46490 2014-03-31      2014         10    C    25.0   2.10 2014-10-17"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "option_selection"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Option Modeling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "uuid": "b2f6b10c-bf01-46f6-958a-e0e6266adbe8"
   },
   "outputs": [],
   "source": [
    "from dxa import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "uuid": "c191a3e9-286e-4c84-8044-aaf05f88377b"
   },
   "outputs": [],
   "source": [
    "me_vstoxx = market_environment('me_vstoxx', pricing_date)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "uuid": "52879659-97e7-4c0f-a14f-b29bea60b3c8"
   },
   "outputs": [],
   "source": [
    "me_vstoxx.add_constant('initial_value', initial_value)\n",
    "me_vstoxx.add_constant('final_date', maturity)\n",
    "me_vstoxx.add_constant('currency', 'EUR')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "uuid": "f1862ff5-ef88-4364-beba-502872ac5450"
   },
   "outputs": [],
   "source": [
    "me_vstoxx.add_constant('frequency', 'B')\n",
    "me_vstoxx.add_constant('paths', 10000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "uuid": "b6c44b38-27b6-4c0e-8713-d4c46e2f46c8"
   },
   "outputs": [],
   "source": [
    "csr = constant_short_rate('csr', 0.01)\n",
    "  # somewhat arbitrarily chosen here"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "uuid": "f0aedd9b-a2c9-4713-a02d-cc5a8959408e"
   },
   "outputs": [],
   "source": [
    "me_vstoxx.add_curve('discount_curve', csr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "uuid": "11c8a827-c54c-451a-93c3-9f8db6df970c"
   },
   "outputs": [],
   "source": [
    "# parameters to be calibrated later\n",
    "me_vstoxx.add_constant('kappa', 1.0)\n",
    "me_vstoxx.add_constant('theta', 1.2 * initial_value)\n",
    "vol_est =  vstoxx_index['V2TX'].std() \\\n",
    "            * np.sqrt(len(vstoxx_index['V2TX']) / 252.)\n",
    "me_vstoxx.add_constant('volatility', vol_est)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "uuid": "e48f0a24-715c-417f-91ce-86ad49e837bc"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0384283035169346"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vol_est"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "uuid": "fd70a940-895e-43a4-a66c-d2c3bcc7c285"
   },
   "outputs": [],
   "source": [
    "vstoxx_model = square_root_diffusion('vstoxx_model', me_vstoxx)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "uuid": "fe6d0c61-4907-4466-98ae-3ca782f83964"
   },
   "outputs": [],
   "source": [
    "me_vstoxx.add_constant('strike', forward)\n",
    "me_vstoxx.add_constant('maturity', maturity)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "uuid": "8e36b826-9439-49f2-b4fa-e35928b8df41"
   },
   "outputs": [],
   "source": [
    "payoff_func = 'np.maximum(maturity_value - strike, 0)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "uuid": "d33efcec-e027-4b1a-8fa1-c13696779de3"
   },
   "outputs": [],
   "source": [
    "vstoxx_eur_call = valuation_mcs_european('vstoxx_eur_call',\n",
    "                        vstoxx_model, me_vstoxx, payoff_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "uuid": "cedcee4e-1135-4b38-9381-d74b306de63e"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.359873"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vstoxx_eur_call.present_value()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "uuid": "a4a9ab6f-0810-403f-b172-d08deb80c582"
   },
   "outputs": [],
   "source": [
    "option_models = {}\n",
    "for option in option_selection.index:\n",
    "    strike = option_selection['STRIKE'].loc[option]\n",
    "    me_vstoxx.add_constant('strike', strike)\n",
    "    option_models[option] = \\\n",
    "                        valuation_mcs_european(\n",
    "                                'eur_call_%d' % strike,\n",
    "                                vstoxx_model,\n",
    "                                me_vstoxx,\n",
    "                                payoff_func)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "uuid": "89ec1029-091b-4ab1-8d60-b7a604c02f69"
   },
   "outputs": [],
   "source": [
    "def calculate_model_values(p0):\n",
    "    ''' Returns all relevant option values.\n",
    "    \n",
    "    Parameters\n",
    "    ===========\n",
    "    p0 : tuple/list\n",
    "        tuple of kappa, theta, volatility\n",
    "    \n",
    "    Returns\n",
    "    =======\n",
    "    model_values : dict\n",
    "        dictionary with model values\n",
    "    '''\n",
    "    kappa, theta, volatility = p0\n",
    "    vstoxx_model.update(kappa=kappa,\n",
    "                        theta=theta,\n",
    "                        volatility=volatility)\n",
    "    model_values = {}\n",
    "    for option in option_models:\n",
    "       model_values[option] = \\\n",
    "         option_models[option].present_value(fixed_seed=True)\n",
    "    return model_values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "uuid": "d16e0a95-8543-4b08-b056-3d4f83d05e51"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{46482: 3.2064010000000001,\n",
       " 46483: 2.4123540000000001,\n",
       " 46484: 1.731028,\n",
       " 46485: 1.178823,\n",
       " 46486: 0.76042100000000001,\n",
       " 46487: 0.46249000000000001,\n",
       " 46488: 0.26366200000000001,\n",
       " 46489: 0.142177,\n",
       " 46490: 0.072190000000000004}"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "calculate_model_values((0.5, 27.5, vol_est))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Calibration Procedure"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "uuid": "6d94c077-ebf9-46e3-8185-d4c80d12116d"
   },
   "outputs": [],
   "source": [
    "i = 0\n",
    "def mean_squared_error(p0):\n",
    "    ''' Returns the mean-squared error given\n",
    "    the model and market values.\n",
    "    \n",
    "    Parameters\n",
    "    ===========\n",
    "    p0 : tuple/list\n",
    "        tuple of kappa, theta, volatility\n",
    "    \n",
    "    Returns\n",
    "    =======\n",
    "    MSE : float\n",
    "        mean-squared error\n",
    "    '''\n",
    "    global i\n",
    "    model_values = np.array(list(calculate_model_values(p0).values()))\n",
    "    market_values = option_selection['PRICE'].values\n",
    "    option_diffs = model_values - market_values\n",
    "    MSE = np.sum(option_diffs ** 2) / len(option_diffs)\n",
    "      # vectorized MSE calculation\n",
    "    if i % 20 == 0:\n",
    "        if i == 0:\n",
    "            print('%4s  %6s  %6s  %6s --> %6s' % \n",
    "                 ('i', 'kappa', 'theta', 'vola', 'MSE'))\n",
    "        print('%4d  %6.3f  %6.3f  %6.3f --> %6.3f' % \n",
    "                (i, p0[0], p0[1], p0[2], MSE))\n",
    "    i += 1\n",
    "    return MSE        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "uuid": "489f4f60-5237-4eff-be12-19abc6583ecb"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   i   kappa   theta    vola -->    MSE\n",
      "   0   0.500  27.500   1.038 -->  4.390\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "4.3899900376937779"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_squared_error((0.5, 27.5, vol_est))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "uuid": "d4d06a9e-929b-4a02-95c1-433529015988"
   },
   "outputs": [],
   "source": [
    "import scipy.optimize as spo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "uuid": "15b93990-3228-4330-b5df-10915827ebcc"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   i   kappa   theta    vola -->    MSE\n",
      "   0   0.500  15.000   0.500 --> 10.393\n",
      "  20   0.500  30.000   1.500 -->  2.071\n",
      "  40   1.000  25.000   3.500 -->  0.180\n",
      "  60   1.500  20.000   5.500 -->  0.718\n",
      "  80   2.000  20.000   1.500 -->  5.501\n",
      " 100   2.500  15.000   3.500 -->  5.571\n",
      " 120   2.500  30.000   5.500 --> 22.992\n",
      " 140   3.000  30.000   1.500 --> 14.493\n",
      "CPU times: user 14.6 s, sys: 2.77 s, total: 17.4 s\n",
      "Wall time: 18 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "i = 0\n",
    "opt_global = spo.brute(mean_squared_error,\n",
    "                ((0.5, 3.01, 0.5),  # range for kappa\n",
    "                 (15., 30.1, 5.),  # range for theta\n",
    "                 (0.5, 5.51, 1)),  # range for volatility\n",
    "                 finish=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "uuid": "359c3f5f-4f47-4e53-a916-85d3c745ed1b"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   i   kappa   theta    vola -->    MSE\n",
      "   0   1.500  20.000   4.500 -->  0.008\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0.0076468730485555626"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i = 0\n",
    "mean_squared_error(opt_global)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "uuid": "9fd46baf-28af-4276-a1c1-b3e521550cdd"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   i   kappa   theta    vola -->    MSE\n",
      "   0   1.500  20.000   4.500 -->  0.008\n",
      "  20   1.510  19.235   4.776 -->  0.008\n",
      "  40   1.563  18.926   4.844 -->  0.005\n",
      "  60   1.555  18.957   4.828 -->  0.005\n",
      "  80   1.556  18.947   4.832 -->  0.005\n",
      " 100   1.556  18.948   4.831 -->  0.005\n",
      " 120   1.556  18.948   4.831 -->  0.005\n",
      "Optimization terminated successfully.\n",
      "         Current function value: 0.004654\n",
      "         Iterations: 64\n",
      "         Function evaluations: 138\n",
      "CPU times: user 14.1 s, sys: 2.65 s, total: 16.8 s\n",
      "Wall time: 18 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "i = 0\n",
    "opt_local = spo.fmin(mean_squared_error, opt_global,\n",
    "                     xtol=0.00001, ftol=0.00001,\n",
    "                     maxiter=100, maxfun=350)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {
    "uuid": "d7c22ea7-b3dd-4408-9ef2-3a986354ba26"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   i   kappa   theta    vola -->    MSE\n",
      "   0   1.556  18.948   4.831 -->  0.005\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0.0046542736439999875"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i = 0\n",
    "mean_squared_error(opt_local)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "uuid": "70b888ee-8d31-46b2-86be-ad95dedd347a"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{46482: 4.7465970000000004,\n",
       " 46483: 4.2869229999999998,\n",
       " 46484: 3.8633459999999999,\n",
       " 46485: 3.4741439999999999,\n",
       " 46486: 3.119211,\n",
       " 46487: 2.7939059999999998,\n",
       " 46488: 2.494882,\n",
       " 46489: 2.2247750000000002,\n",
       " 46490: 1.9811099999999999}"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "calculate_model_values(opt_local)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {
    "uuid": "d6cf96da-5139-435e-8ed9-6be593fa7a15"
   },
   "outputs": [],
   "source": [
    "pd.options.mode.chained_assignment = None\n",
    "option_selection['MODEL'] = \\\n",
    "        np.array(list(calculate_model_values(opt_local).values()))\n",
    "option_selection['ERRORS'] = \\\n",
    "        option_selection['MODEL'] - option_selection['PRICE']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "uuid": "716cd81a-0e06-405c-ade7-7fa407ce19cb"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>MODEL</th>\n",
       "      <th>PRICE</th>\n",
       "      <th>ERRORS</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>46482</th>\n",
       "      <td>4.746597</td>\n",
       "      <td>4.85</td>\n",
       "      <td>-0.103403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46483</th>\n",
       "      <td>4.286923</td>\n",
       "      <td>4.30</td>\n",
       "      <td>-0.013077</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46484</th>\n",
       "      <td>3.863346</td>\n",
       "      <td>3.80</td>\n",
       "      <td>0.063346</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46485</th>\n",
       "      <td>3.474144</td>\n",
       "      <td>3.40</td>\n",
       "      <td>0.074144</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46486</th>\n",
       "      <td>3.119211</td>\n",
       "      <td>3.05</td>\n",
       "      <td>0.069211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46487</th>\n",
       "      <td>2.793906</td>\n",
       "      <td>2.75</td>\n",
       "      <td>0.043906</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46488</th>\n",
       "      <td>2.494882</td>\n",
       "      <td>2.50</td>\n",
       "      <td>-0.005118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46489</th>\n",
       "      <td>2.224775</td>\n",
       "      <td>2.25</td>\n",
       "      <td>-0.025225</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46490</th>\n",
       "      <td>1.981110</td>\n",
       "      <td>2.10</td>\n",
       "      <td>-0.118890</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          MODEL  PRICE    ERRORS\n",
       "46482  4.746597   4.85 -0.103403\n",
       "46483  4.286923   4.30 -0.013077\n",
       "46484  3.863346   3.80  0.063346\n",
       "46485  3.474144   3.40  0.074144\n",
       "46486  3.119211   3.05  0.069211\n",
       "46487  2.793906   2.75  0.043906\n",
       "46488  2.494882   2.50 -0.005118\n",
       "46489  2.224775   2.25 -0.025225\n",
       "46490  1.981110   2.10 -0.118890"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "option_selection[['MODEL', 'PRICE', 'ERRORS']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "uuid": "91c24e54-e18a-4cfe-88b2-82ef82947b9c"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.002"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "round(option_selection['ERRORS'].mean(), 3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {
    "uuid": "9d2912c2-9ab3-4423-95d5-984df6f9f31e"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHjCAYAAACuF1KUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzs3Xl8VPW9//HXZN/3PSEQIPmGHUQg\nuAFq1bpUUXpra1st3rp1kavtr3axamtbrlu1i7e2F29rN1tRrBartYo7CMoe4BsCIYFAQshCAoFA\nkvn9MUMaIWGRTM4s7+fjwYPMOWfOfE4+mckn3/NdXG63GxEREREJfGFOByAiIiIiA0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AcDfAA8Cu1As\nllgLfJdi0cR2itukl5aHfC0z/zEiXg9cDnwAWF22PZ/i9upJwDcobsd+CbiKYgZvJsUCisczc21E\nLKB4nu/XwE7lvhWZ6S9rSSMysZMkSaoIb8VKkiRVhImdJElSRZjYSZIkVYSJnSRJUkWY2EmSJFWE\niZ0kSVJFmNhJkiRVhImdJElSRfw/0YIfoK0uDNoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x108a63438>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "fix, (ax1, ax2) = plt.subplots(2, sharex=True, figsize=(10, 8))\n",
    "strikes = option_selection['STRIKE'].values\n",
    "ax1.plot(strikes, option_selection['PRICE'], label='market quotes')\n",
    "ax1.plot(strikes, option_selection['MODEL'], 'ro', label='model values')\n",
    "ax1.set_ylabel('option values')\n",
    "ax1.grid(True)\n",
    "ax1.legend(loc=0)\n",
    "wi = 0.25\n",
    "ax2.bar(strikes - wi / 2., option_selection['ERRORS'],\n",
    "        label='market quotes', width=wi)\n",
    "ax2.grid(True)\n",
    "ax2.set_ylabel('differences')\n",
    "ax2.set_xlabel('strikes');\n",
    "# tag: vstoxx_calibration\n",
    "# title: Calibrated model values for VSTOXX call options vs. market quotes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## American Options on the VSTOXX"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Modeling Option Positions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {
    "uuid": "40decf0f-1908-48e8-b5c3-0fa5b667575c"
   },
   "outputs": [],
   "source": [
    "me_vstoxx = market_environment('me_vstoxx', pricing_date)\n",
    "me_vstoxx.add_constant('initial_value', initial_value)\n",
    "me_vstoxx.add_constant('final_date', pricing_date)\n",
    "me_vstoxx.add_constant('currency', 'NONE')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {
    "uuid": "88c93f7b-7944-4724-8b7d-a8f9d231d926"
   },
   "outputs": [],
   "source": [
    "# adding optimal parameters to environment\n",
    "me_vstoxx.add_constant('kappa', opt_local[0])\n",
    "me_vstoxx.add_constant('theta', opt_local[1])\n",
    "me_vstoxx.add_constant('volatility', opt_local[2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "uuid": "8d92c037-79db-4663-9ad4-863dc720d160"
   },
   "outputs": [],
   "source": [
    "me_vstoxx.add_constant('model', 'srd')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "uuid": "ee26163e-cfc2-4bd4-99ef-d9d877dc9592"
   },
   "outputs": [],
   "source": [
    "payoff_func = 'np.maximum(strike - instrument_values, 0)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {
    "uuid": "f4882acb-2157-4073-b2e7-b9c79a428a2c"
   },
   "outputs": [],
   "source": [
    "shared = market_environment('share', pricing_date)\n",
    "shared.add_constant('maturity', maturity)\n",
    "shared.add_constant('currency', 'EUR')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {
    "uuid": "e48619d3-c12d-4387-bc0d-51dccd00d19e"
   },
   "outputs": [],
   "source": [
    "option_positions = {}\n",
    "  # dictionary for option positions\n",
    "option_environments = {}\n",
    "  # dictionary for option environments\n",
    "for option in option_selection.index:\n",
    "    option_environments[option] = \\\n",
    "        market_environment('am_put_%d' % option, pricing_date)\n",
    "        # define new option environment, one for each option\n",
    "    strike = option_selection['STRIKE'].loc[option]\n",
    "      # pick the relevant strike\n",
    "    option_environments[option].add_constant('strike', strike)\n",
    "      # add it to the environment\n",
    "    option_environments[option].add_environment(shared)\n",
    "      # add the shared data\n",
    "    option_positions['am_put_%d' % strike] = \\\n",
    "                    derivatives_position(\n",
    "                        'am_put_%d' % strike,\n",
    "                        quantity=100.,\n",
    "                        underlying='vstoxx_model',\n",
    "                        mar_env=option_environments[option],\n",
    "                        otype='American',\n",
    "                        payoff_func=payoff_func)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### The Options Portfolio"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {
    "uuid": "f885f822-7d78-4841-99c5-f30f1bf23ebb"
   },
   "outputs": [],
   "source": [
    "val_env = market_environment('val_env', pricing_date)\n",
    "val_env.add_constant('starting_date', pricing_date)\n",
    "val_env.add_constant('final_date', pricing_date)\n",
    "  # temporary value, is updated during valuation\n",
    "val_env.add_curve('discount_curve', csr)\n",
    "val_env.add_constant('frequency', 'B')\n",
    "val_env.add_constant('paths', 25000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "uuid": "d9a3a473-3cfb-49ab-be94-848349683a9a"
   },
   "outputs": [],
   "source": [
    "underlyings = {'vstoxx_model' : me_vstoxx}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "uuid": "590ae8ed-39b9-42a3-84f2-35b2b400d8b8"
   },
   "outputs": [],
   "source": [
    "portfolio = derivatives_portfolio('portfolio', option_positions,\n",
    "                                  val_env, underlyings)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {
    "uuid": "11539da8-35b0-4daf-94ee-52aae7d9fca8"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 58.1 s, sys: 8.36 s, total: 1min 6s\n",
      "Wall time: 38.7 s\n"
     ]
    }
   ],
   "source": [
    "%time results = portfolio.get_statistics(fixed_seed=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "uuid": "883fa311-3410-4572-a8d1-a526e2914f69"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>quant.</th>\n",
       "      <th>value</th>\n",
       "      <th>curr.</th>\n",
       "      <th>pos_value</th>\n",
       "      <th>pos_delta</th>\n",
       "      <th>pos_vega</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>am_put_17</td>\n",
       "      <td>100.0</td>\n",
       "      <td>4.575197</td>\n",
       "      <td>EUR</td>\n",
       "      <td>457.5197</td>\n",
       "      <td>-24.85</td>\n",
       "      <td>102.77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>am_put_18</td>\n",
       "      <td>100.0</td>\n",
       "      <td>5.203648</td>\n",
       "      <td>EUR</td>\n",
       "      <td>520.3648</td>\n",
       "      <td>-30.62</td>\n",
       "      <td>107.93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>am_put_19</td>\n",
       "      <td>100.0</td>\n",
       "      <td>5.872686</td>\n",
       "      <td>EUR</td>\n",
       "      <td>587.2686</td>\n",
       "      <td>-33.31</td>\n",
       "      <td>107.79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>am_put_20</td>\n",
       "      <td>100.0</td>\n",
       "      <td>6.578714</td>\n",
       "      <td>EUR</td>\n",
       "      <td>657.8714</td>\n",
       "      <td>-34.82</td>\n",
       "      <td>110.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>am_put_21</td>\n",
       "      <td>100.0</td>\n",
       "      <td>7.320523</td>\n",
       "      <td>EUR</td>\n",
       "      <td>732.0523</td>\n",
       "      <td>-39.46</td>\n",
       "      <td>105.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>am_put_22</td>\n",
       "      <td>100.0</td>\n",
       "      <td>8.081625</td>\n",
       "      <td>EUR</td>\n",
       "      <td>808.1625</td>\n",
       "      <td>-40.61</td>\n",
       "      <td>102.38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>am_put_23</td>\n",
       "      <td>100.0</td>\n",
       "      <td>8.871962</td>\n",
       "      <td>EUR</td>\n",
       "      <td>887.1962</td>\n",
       "      <td>-43.26</td>\n",
       "      <td>104.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>am_put_24</td>\n",
       "      <td>100.0</td>\n",
       "      <td>9.664272</td>\n",
       "      <td>EUR</td>\n",
       "      <td>966.4272</td>\n",
       "      <td>-40.14</td>\n",
       "      <td>101.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>am_put_25</td>\n",
       "      <td>100.0</td>\n",
       "      <td>10.475168</td>\n",
       "      <td>EUR</td>\n",
       "      <td>1047.5168</td>\n",
       "      <td>-45.74</td>\n",
       "      <td>102.81</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        name  quant.      value curr.  pos_value  pos_delta  pos_vega\n",
       "0  am_put_17   100.0   4.575197   EUR   457.5197     -24.85    102.77\n",
       "1  am_put_18   100.0   5.203648   EUR   520.3648     -30.62    107.93\n",
       "2  am_put_19   100.0   5.872686   EUR   587.2686     -33.31    107.79\n",
       "3  am_put_20   100.0   6.578714   EUR   657.8714     -34.82    110.01\n",
       "4  am_put_21   100.0   7.320523   EUR   732.0523     -39.46    105.20\n",
       "5  am_put_22   100.0   8.081625   EUR   808.1625     -40.61    102.38\n",
       "6  am_put_23   100.0   8.871962   EUR   887.1962     -43.26    104.37\n",
       "7  am_put_24   100.0   9.664272   EUR   966.4272     -40.14    101.04\n",
       "8  am_put_25   100.0  10.475168   EUR  1047.5168     -45.74    102.81"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results.sort_values(by='name')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {
    "uuid": "8ceae186-64e2-405d-8563-b6349c0f13b2"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pos_value    6664.3795\n",
       "pos_delta    -332.8100\n",
       "pos_vega      944.3000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results[['pos_value','pos_delta','pos_vega']].sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Conclusions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Further Reading"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>\n",
    "\n",
    "<a href=\"http://tpq.io\" target=\"_blank\">http://tpq.io</a> | <a href=\"http://twitter.com/dyjh\" target=\"_blank\">@dyjh</a> | <a href=\"mailto:training@tpq.io\">training@tpq.io</a>\n",
    "\n",
    "**Quant Platform** |\n",
    "<a href=\"http://quant-platform.com\">http://quant-platform.com</a>\n",
    "\n",
    "**Python for Finance** |\n",
    "<a href=\"http://python-for-finance.com\" target=\"_blank\">Python for Finance @ O'Reilly</a>\n",
    "\n",
    "**Derivatives Analytics with Python** |\n",
    "<a href=\"http://derivatives-analytics-with-python.com\" target=\"_blank\">Derivatives Analytics @ Wiley Finance</a>\n",
    "\n",
    "**Listed Volatility and Variance Derivatives** |\n",
    "<a href=\"http://lvvd.tpq.io\" target=\"_blank\">Listed VV Derivatives @ Wiley Finance</a>\n",
    "\n",
    "**Python Training** |\n",
    "<a href=\"http://training.tpq.io\" target=\"_blank\">Python for Finance University Certificate</a>"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
